package com.card.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.card.dao.CardInfoMapper;
import com.card.entity.CardInfo;
import com.card.service.CardInfoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class CardInfoServiceImpl extends ServiceImpl<CardInfoMapper, CardInfo> implements CardInfoService  {

    @Resource
    private CardInfoMapper cardInfoMapper;

    @Override
    public CardInfo getCardInfo(String openId) {
        LambdaQueryWrapper<CardInfo> cardInfoLambdaQueryWrapper = new LambdaQueryWrapper<>();
        cardInfoLambdaQueryWrapper.eq(CardInfo::getOpenId, openId);
        return cardInfoMapper.selectOne(cardInfoLambdaQueryWrapper);
    }
}
